package game.Config;

import game.Actors.Bullet;
import game.Actors.FadingBullet;
import game.Actors.FireBullet;
import game.Actors.IceBullet;
import game.Actors.RicochetBullet;
import game.Actors.RocketBullet;

import org.newdawn.slick.geom.Vector2f;

public class BulletFactory {

	
	/**
	 * Creates a fading ice bullet.
	 * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 * @param freezeTime The time the bullet will freeze the enemy.
	 * @param freezePercent The percent the bullet will remove of the enemies speed.
	 */
	public static void createIceBullet(float damage,float speed, Vector2f position,Vector2f direction,float fadeDistance,float freezeTime,float freezePercent) {
		new IceBullet(Config.iceBulletImage,position.copy(),speed,direction.copy(),damage,fadeDistance,freezeTime,freezePercent);
		
	}
	
	/**
	 * Creates a fire bullet
	 * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 * @param fadeDistance The max distance of the bullet.
	 * @param burnDuration The time the fire from the bullet will affect the enemy.
	 * @param burnDamage The amount of damage the fire from the bullet will damage the enemy.
	 */
	public static void createFireBullet(float damage, float speed,Vector2f position, Vector2f direction,float fadeDistance,float burnDuration,float burnDamage) {
		new FireBullet(Config.standardBulletImage,position.copy(),speed,direction.copy(),fadeDistance,damage,burnDuration,burnDamage);
		//Image image, Vector2f position, float speed,Vector2f direction, float fadeDistance,float damage,float burnDuration,float burnDamage
	}
	
	/**
	 * Creates a fading bullet.
	 * A fading bullet means a bullet that has a specified lifetime.
	 * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 * @param fadeDistance The max distance the bullet can travel.
	 */
	public static void createFadingBullet(float damage, float speed, Vector2f position,Vector2f direction, float fadeDistance){
		new FadingBullet(Config.standardBulletImage,position.copy(),speed,direction.copy(),damage,fadeDistance);
	}
	
	/**
	 * Creates a standard bullet.
	 * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 */
	public static void createStandardBullet(float damage, float speed,Vector2f position,Vector2f direction) {
		new Bullet(Config.standardBulletImage,position.copy(),speed,direction.copy(),damage);
	}
	

	/**
	 * Creates rocket bullet.
	 * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 * @param explosionRadius The radius of the explosion. The enemies within this radus will be damaged.
	 */
	public static void createRocketBullet(float damage, float speed, Vector2f position,Vector2f direction, float explosionRadius){
		//Image image, Vector2f position, float speed,Vector2f direction, float damage,float explosionRadius
		new RocketBullet(Config.rocketBulletImage,position.copy(),speed,direction.copy(),damage,explosionRadius,Config.explosionSheet);
	}
	
	/**
	 * Creates a mine bullet
	 * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 * @param explosionRadius The radius of the explosion. The enemies within this radus will be damaged.
	 */
	public static void createMineBullet(float damage, float speed, Vector2f position, Vector2f direction, float explosionRadius){
		new RocketBullet(Config.mineBulletImage,position.copy(),speed,direction.copy(),damage,explosionRadius,Config.explosionSheet);
	}
	
	/**
	 * Creates a ricochetbullet. This bullet will bounce between enemeies.
	  * @param damage The damage of the bullet.
	 * @param speed The speed of the bullet
	 * @param position The start position of the bullet
	 * @param direction The direction the bullet shall travel in.
	 * @param bounceRadius The max distance the enemies can have from the bullet to be considered for richostation. 
	 * @param maximumTargets The number of bounces.
	 */
	public static void createRicochetBullet(float damage, float speed, Vector2f position, Vector2f direction,float bounceRadius,int maximumTargets){
		//Image image, Vector2f position, float speed,Vector2f direction, float damage,float bounceRadius,int targetsRemaining,Enemy previousTarget
		new RicochetBullet(Config.standardBulletImage,position.copy(),speed,direction.copy(),damage,bounceRadius,maximumTargets,null);
	}
}
